<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/comm/common.jsp" %>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="<%=path %>/css/pintuer.css">
<link rel="stylesheet" href="<%=path %>/css/admin.css">
<script src="<%=path %>/js/jquery.js"></script>
<script src="<%=path %>/js/pintuer.js"></script>
</head>
<body>
<form method="post" action="<%=path%>/system/Area_listArea.action" id="listform">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder">行政区域管理 </strong> </div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-green icon-plus-square-o" href="<%=path%>/system/Area_inputArea.action"> 添加行政区域</a> </li>
        <li>搜索：</li>
       
     
       <li>
          <input type="text" placeholder="请输入区域关键字" name="areaForm.area_name" class="input" style="width:250px; line-height:17px;display:inline-block" />
          <a href="javascript:void(0)" class="button border-main icon-search" onclick="changesearch()" > 搜索</a></li>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="100" style="text-align:left; padding-left:20px;"><input type="checkbox" name="checkall" id="checkall">
        <label for="checkall"></label></th>
        <th>区域编号</th>
        <th>区域名称</th>
        <th>区域级别</th>
        <th>操作</th>
      </tr>
      <s:iterator id="item" value="pageList.dataSets" status="i" >
        <tr>
          <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="ids" value="${id}" />
           ${i.index+1}</td>
          <td>${area_no}</td>
          <td>${area_name}</td>
          <td><font color="#00CC99">${area_level}</td>
      
          <td><div class="button-group"> <a class="button border-main" href="<%=path%>/system/Area_editArea.action?area_no=${area_no}"><span class="icon-edit"></span> 修改</a>
           <a class="button border-red" href="<%=path%>/system/Area_delArea.action?area_no=${area_no}"  ><span class="icon-trash-o"></span> 删除</a> 
           </div></td>
        </tr>
        </s:iterator>
    </table>
  </div>
  <s:if test="%{#attr.pageList!=null}" >
    <div class="pagelist">
      共有${pageList.total}条记录，当前显示第${pageList.page}页
      <s:if test="%{#attr.pageList.hasPre}">
        <a href="<%=path %>/system/Area_listArea.action?page=${pageList.page-1}">上一页</a>
      </s:if>
      <s:else> <a href="<%=path %>/system/Area_listArea.action?page=1">上一页</a></s:else>
      <s:if test="%{#attr.pageList.hasNext}">
        <a href="<%=path %>/system/Area_listArea.action?page=${pageList.page+1}">下一页</a>
      </s:if>
     
        <a href="<%=path %>/system/Area_listArea.action?page=${pageList.totalPage}">尾页</a>
      </div>
  </s:if>

</form>
<script type="text/javascript">

//搜索
function changesearch(){
	
 $("#listform").submit();
}
//全选
$("#checkall").click(function(){ 
  $("input[name='id[]']").each(function(){
	  if (this.checked) {
		  this.checked = false;
	  }
	  else {
		  this.checked = true;
	  }
  });
})

//批量删除
function delSelect(){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		var t=confirm("您确认要删除选中的内容吗？");
		if (t==false) return false;		
		$("#listform").submit();		
	}
	else{
		alert("请选择您要删除的内容!");
		return false;
	}
}

</script>
</body>
</html>
